package com.nulldev.util.security.encryptAPI_rw.impls.rabbit;

import com.nulldev.util.JVM.JVM;
import com.nulldev.util.VariableAPI.ByteUtil;
import com.nulldev.util.VariableAPI.RandomUtil;
import com.nulldev.util.io.FastIO.FastIO;

public class RabbitCipherTest {

	public static void main(String[] args) {
		final RabbitCipher rabbit = new RabbitCipher();
		JVM.println("Generating a random key...");
		final byte[] key = RandomUtil.bytes(32);
		JVM.println("KEY: " + ByteUtil.getHex(key));
		final String testString = "Hello Rabbit world! This is our streaming cipher.";
		final byte[] enc = rabbit.encrypt(testString.getBytes(), key);
		final String _enc = new String(enc);
		JVM.println("_enc: " + _enc);
		final byte[] dec = rabbit.decrypt(enc, key);
		final String out = new String(dec);
		JVM.println("out: " + out);
		FastIO.get().flush();
		JVM.exit();
	}

}
